package com.tensquare.friend.dao;

import com.tensquare.friend.pojo.Friend;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

/**
 * @BelongsProject: tensquare_parent
 * @BelongsPackage: com.tensquare.friend.dao
 * @Author: yang
 * @CreateTime: 2019-03-13 13:41
 * @Description: ${Description}
 */
public interface FriendDao extends JpaRepository<Friend,String> {
   public Friend findByUseridAndFriendid(String userid,String friendid);


   //更新
    @Modifying
    @Query(value = "update tb_friend set islike=? where userid =? and friendid=?",nativeQuery = true)
   public void UpdateIslike(String islike,String userid,String friendid);

    //删除
    @Modifying
    @Query(value = "delete from tb_friend where userid=? and friendid=?",nativeQuery = true)
    public void deleteFriend(String userid, String friendid);
}
